*---------in study 1-------------
 use "E:\交博\论文\复制研究\PAR复制实验FAN\PAstata数据\PA study1.dta"
*Scenario 1
describe         
local catvars  Gender   Hukou Fstatus  PIdentity
foreach v of local catvars {
    di as txt "—— Var：`v' ——"
    tabulate `v'  Group1, column chi2
}
tabulate Group1 
anova Age Group1


*Scenario 2              
local catvars  Gender   Hukou Fstatus  PIdentity
foreach v of local catvars {
    di as txt "—— Var：`v' ——"
    tabulate `v'  Group2, column chi2
}
tabulate Group2 
anova Age Group2

*Manipulation check

tab Manipulation1 Group1, missing
tab Manipulation2 Group2, missing


*Hypothesis test 
oneway  CM Group1, bonferroni  
pwmean CM, over(Group1) effects mcompare(bonferroni)  

*Hypothesis test 
anova  CM Group1 
pwmean CM, over(Group1) effects 
tabstat CM, by(Group1) stat(mean sd n)

anova   CD Group2
pwmean CD, over(Group2) effects 
tabstat CD, by(Group2) stat(mean sd n)
tabulate Contact3 Group2, column chi2

reg  CM  Group1 Gender Age PIdentity  Hukou Fstatus Volunteer  hotline, beta
reg CD Group2 Gender Age  PIdentity Hukou Fstatus Volunteer  teaching, beta

logistic  Contact1 i.Group1 Gender Age PIdentity  Hukou Fstatus Volunteer  hotline
logistic  Contact3 i.Group2 Gender Age PIdentity  Hukou Fstatus Volunteer  hotline

ttest CM == CD

*---------in study 2-------------
use "E:\交博\论文\复制研究\PAR复制实验FAN\PAstata数据\PAstudy2.dta"
*Sample description and balance test
*Scenario 1
describe         
local catvars  Q19Gender  Q20Age  Q22Hukou Q24Fstatus  Q21Education Q23PIdentity
foreach v of local catvars {
    di as txt "—— Var：`v' ——"
    tabulate `v'  Group1, column chi2
}
tabulate Group1 

*Scenario 2      
local catvars  Q19Gender  Q20Age  Q22Hukou Q24Fstatus  Q21Education Q23PIdentity
foreach v of local catvars {
    di as txt "—— Var：`v' ——"
    tabulate `v'  Group2, column chi2
}
tabulate Group2 

*Manipulation check

tab Q6Manipulation1 Group1, missing
tab Q33Manipulation2 Group2, missing


*Hypothesis test 
oneway  CM Group1, bonferroni  
pwmean CM, over(Group1) effects mcompare(bonferroni)  

*Hypothesis test 
anova  CM Group1 
pwmean CM, over(Group1) effects 

anova   CD Group2
pwmean CD, over(Group2) effects 

tabstat CM, by(Group1) stat(mean sd n)
tabstat CD, by(Group2) stat(mean sd n)

logistic  Contact2 i.Group2 Q19Gender Q20Age Q21Education Q23PIdentity Q22Hukou Q24Fstatus Volunteer Garbage
tabulate Contact2 Group2, column chi2

ttest CM == CD

reg  CM Q19Gender Q20Age Q21Education  Q23PIdentity Q22Hukou Q24Fstatus Volunteer  hotline, beta
reg  CM  Group1 Q19Gender Q20Age Q21Education Q23PIdentity Q22Hukou Q24Fstatus Volunteer  hotline, beta

reg CD  Q19Gender Q20Age Q21Education Q23PIdentity Q22Hukou Q24Fstatus Volunteer Garbage, beta
reg CD Group2 Q19Gender Q20Age Q21Education  Q23PIdentity Q22Hukou  Q24Fstatus Volunteer Garbage, beta

